package thread;
//观察线程的状态和转移
public class ThreadDemo10 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            for(int i = 0; i < 10000; i++){

            }
        }, "李四");

        //NEW 状态
        System.out.println(t.getName() + " : " + t.getState());
        t.start();
        while(t.isAlive()){
            //RUNNABLE 状态
            System.out.println(t.getName() + " : " + t.getState());
        }
        //TERMINATED 状态
        System.out.println(t.getName() + " : " + t.getState());
    }
}
